<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<f:view>
    <link href="/general/css/admin_2.css" rel="stylesheet" type="text/css"/>
    <link href="/general/css/admin_1.css" rel="stylesheet" type="text/css"/>
    <h:form styleClass="fondoFormulariosyPanel">
        <h:panelGrid columns="1" width="100%" styleClass="tablaprincipal">
            <h:outputLabel value="Reporte De Utilidades" />
        </h:panelGrid>
        <a4j:outputPanel ajaxRendered="true">
            <h:messages id="lblMessages" styleClass="messages" infoClass="infoClass" errorClass="errorClass"
                        warnClass="warnClass" showDetail="true" errorStyle="color:red;"
                        warnStyle="color:green;" infoStyle="color:black;" fatalStyle="color:black"/>
        </a4j:outputPanel>
        <rich:spacer width="50" height="60"/>
        <h:panelGrid columns="3" style="margin-left:15%;font-size:11" styleClass="fondoFormulariosyPanel">
            <h:panelGrid columns="2" styleClass="fondoFormulariosyPanel" border="1">
                <h:selectBooleanCheckbox value="#{RepEIController.bcapitulo}" />
                <h:outputLabel value="Capitulo"/>
                <h:selectBooleanCheckbox value="#{RepEIController.barea}" />
                <h:outputLabel value="Area"/>
                <h:selectBooleanCheckbox value="#{RepEIController.bevento}" />
                <h:outputLabel value="Evento"/>
                <h:selectBooleanCheckbox value="#{RepEIController.bfechas}" />
                <h:outputLabel value="Fechas"/>
            </h:panelGrid>
            <h:panelGrid columns="3" styleClass="fondoFormulariosyPanel" border="1">
                <h:outputLabel value="Capitulo"/>
                <h:selectOneMenu value="#{RepEIController.codCapitulo}">
                    <f:selectItem itemLabel="Todos" itemValue="0"/>
                    <f:selectItem itemLabel="Ing Agricola" itemValue="0"/>
                    <f:selectItem itemLabel="Ing Agronomica" itemValue="0"/>
                    <f:selectItem itemLabel="Ing Civil" itemValue="0"/>
                    <f:selectItem itemLabel="Ing Sistemas, Computacion e Informatica" itemValue="0"/>
                    <f:selectItem itemLabel="Ing Industrial, Economica y Administrativa" itemValue="0"/>
                    <f:selectItem itemLabel="Ing Electrónica" itemValue="0"/>
                    <f:selectItem itemLabel="Ing Geológica,Minera, Metalurgica" itemValue="0"/>
                    <f:selectItem itemLabel="Ing Mecanica, Electrica" itemValue="0"/>
                    <f:selectItem itemLabel="Ing Pesquería" itemValue="0"/>
                    <f:selectItem itemLabel="Ing Química" itemValue="0"/>
                    <f:selectItem itemLabel="Ing Zootecnista" itemValue="0"/>
                </h:selectOneMenu><br/>

                <h:outputLabel value="Area"/>
                <h:selectOneMenu value="#{RepEIController.codArea}">
                    <f:selectItem itemLabel="Todas" itemValue="0"/>
                    <f:selectItem itemLabel="Capacitacion y Eventos" itemValue="0"/>
                    <f:selectItem itemLabel="Capitulos" itemValue="0"/>
                    <f:selectItem itemLabel="Decanato" itemValue="0"/>
                    <f:selectItem itemLabel="Secretaria" itemValue="0"/>
                </h:selectOneMenu><br/>

                <h:outputLabel value="Nombre Evento"/>
                <h:inputText id="city" value="#{RepEIController.evento}" size="45"/>
                <rich:suggestionbox for="city" var="item" height="140" width="360"
                                    fetchValue="#{item.preevento.preNombre}" minChars="1" nothingLabel="No existen Evento"
                                    suggestionAction="#{EventoController.autocompletarEventos}">
                    <h:column>
                        <h:outputText value="#{item.preevento.preNombre}" />
                    </h:column>
                    <a4j:support event="onselect">
                        <f:setPropertyActionListener value="#{item.preevento.preCodigo}" target="#{RepEIController.codEvento}" />
                    </a4j:support>
                </rich:suggestionbox>

                <h:outputLabel value="Desde"/>
                <rich:calendar value="#{RepEIController.desde}" datePattern="dd/MM/yyyy"/><br/>

                <h:outputLabel value="Hasta"/>
                <rich:calendar value="#{RepEIController.hasta}" datePattern="dd/MM/yyyy"/>

                <h:commandButton value="Buscar" title="Buscar" action="#{RepEIController.buscarUtilidades}" image="/img/excel.png"/>
            </h:panelGrid>

        </h:panelGrid>
    </h:form>
</f:view>

